home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / prospero / propsero.lha / prospero-beta.4.2e / user / af.c next >
C/C++ Source or Header  |  1992-02-10  |  901b  |  50 lines

  1. /*
  2.  * Copyright (c) 1989, 1990 by the University of Washington
  3.  *
  4.  * For copying and distribution information, please see the file
  5.  * <uw-copyright.h>.
  6.  */
  7.  
  8. #include <uw-copyright.h>
  9. #include <stdio.h>
  10. #include <strings.h>
  11.  
  12. #include <pfs.h>
  13. #include <perrno.h>
  14.  
  15. int    perrno;
  16. int    pfs_debug = 0;
  17.  
  18. main(argc,argv)
  19.     int        argc;
  20.     char    *argv[];
  21.     {
  22.     int        tmp;
  23.  
  24.     argc--;argv++;
  25.  
  26.     if ((argc > 0) && (strncmp(argv[0],"-D",2) == 0)) {
  27.         pfs_debug = 1; /* Default debug level */
  28.         sscanf(argv[0],"-D%d",&pfs_debug);
  29.         argc--;argv++;
  30.     }
  31.  
  32.     if(argc < 2) {
  33.         fprintf(stderr,"Usage: af link filter [args]\n");
  34.         exit(1);
  35.     }        
  36.  
  37.     if(argc > 2) tmp = add_filter(argv[0],argv[1],argv[2]);
  38.     else tmp = add_filter(argv[0],argv[1],NULL);
  39.  
  40.     if(tmp) {
  41.         fprintf(stderr,"%s",argv[0]);
  42.         perrmesg(" failed: ", tmp, NULL);
  43.         exit(1);
  44.     }
  45.  
  46.     if(pwarn) pwarnmesg("WARNING: ",0,NULL);
  47.  
  48.     exit(0);
  49.     }
  50.